package com.testmanager.testmananger.shuiyou.szjk.mapper;

import com.testmanager.testmananger.shuiyou.szjk.domain.ChangeExpressionEntity;
import com.testmanager.testmananger.shuiyou.szjk.domain.ChangeRecordEntity;
import com.testmanager.testmananger.shuiyou.szjk.dto.ChangeExpressionDto;

public class ChangeExpressionMapper {



    public static ChangeExpressionDto toChangeExpressionDto(ChangeExpressionEntity changeExpressionEntity){
        ChangeExpressionDto changeExpressionDto = new ChangeExpressionDto();
        return changeExpressionDto.setId(changeExpressionEntity.getId())
                .setExpression(changeExpressionEntity.getExpression())
                .setChangeValue(changeExpressionEntity.getChangeValue())
                .setType(changeExpressionEntity.getType())
                .setFileName(changeExpressionEntity.getFileName())
                .setZipFileId(changeExpressionEntity.getZipFileId());
    }


    public static ChangeExpressionEntity toChangeExpressionEntity(ChangeExpressionDto changeExpressionDto,long changeRecordId){
        ChangeExpressionEntity changeExpressionEntity = new ChangeExpressionEntity();
        return changeExpressionEntity.setId(changeExpressionDto.getId())
                .setChangeRecordId(changeRecordId)
                .setChangeValue(changeExpressionDto.getChangeValue())
                .setExpression(changeExpressionDto.getExpression())
                .setFileName(changeExpressionDto.getFileName())
                .setType(changeExpressionDto.getType())
                .setZipFileId(changeExpressionDto.getZipFileId());
    }

}
